import React, { Component } from 'react';
import '../styles/Artist.scss'
import { NavBar } from 'antd-mobile'
import * as service from '../api/index'

class Artist extends Component {
    state = {
        artistlist: []
    }
    async componentDidMount() {
        let res = await service.artistlist()
        // console.log(res.data.list);
        this.setState({ artistlist: res.data.list })
    }
    back = () => {
        this.props.history.goBack()
    }
    render() {
        return (
            <div className='artist'>
                <NavBar onBack={() => { this.back() }}>热门艺人</NavBar>
                <div className="artistlist">
                    {
                        this.state.artistlist.map((item, index) => {
                            return (
                                <div className="item">
                                    <img src={item.pic} alt="" />
                                    <div className="text">

                                        <div className="name">
                                            {item.name}
                                        </div>
                                        <div className="number">
                                            {item.number}
                                        </div>
                                        
                                    </div>
                                    <div className="see">查看</div>
                                </div>
                            )
                        })
                    }
                </div>
            </div>
        );
    }
}

export default Artist;